package com.zt.bigdata.elasticsearch.dao;

import com.zt.bigdata.elasticsearch.entity.Account;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Component;

/**
 *
 */
@Component
public interface AccountRepository extends ElasticsearchRepository<Account, String> {
    Account findAccountById(String id);

    Account findAccountByFirstnameAndLastname(String firstname, String lastname);

    Account findAccountByFirstname(String firstname);

    Page<Account> findByState(String author, Pageable pageable);

    Page<Account> findByGender(String gender, Pageable pageable);

    Page<Account> findBankByAgeBetween(Integer left, Integer right, Pageable pageable);

    Page<Account> findBankByAgeBetweenAndGender(Integer left, Integer right, String gender, Pageable pageable);
}
